/*
 * Copyright (c) 2008 Benoit Bouchez, Nicolas Giard
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package com.noocodecommit.wicket.stuff.jquery.plugin.ui.accordion;

import com.noocodecommit.wicket.stuff.jquery.plugin.JQPluginOptions;
import com.noocodecommit.wicket.stuff.jquery.plugin.effects.JQAnimation;

/**
 * JQAccordion Option set
 * 
 * @author Benoit Bouchez
 * 
 */
public class JQAccordionOptions extends JQPluginOptions
{
	private Object active = "";
	private Object animated = JQAnimation.ANIMATIONSTYLE_SLIDE;
	private String selectedClass = "selected";
	private String event = "click";
	private String header = "a";
	private String navigationFilter = "";
	private boolean alwaysOpen = true;
	private boolean navigation = false;
	private boolean autoHeight = true;
	private boolean clearStyle = false;
	private boolean fillSpace = false;

	/**
	 * Constructor
	 */
	public JQAccordionOptions()
	{
		super();
		this.setDefaultHeader("accordion");
	}

	/**
	 * Gets the header value
	 * 
	 * @return the header value
	 */
	public String getHeader()
	{
		return header;
	}

	/**
	 * Sets the header option value
	 * 
	 * @param header
	 *            accordion header
	 */
	public void setHeader(String header)
	{
		this.header = header;
		this.options.put("header", "header:'" + header + "'");
	}

	/**
	 * Gets the active value
	 * 
	 * @param scope
	 * @return the active value
	 */
	public Object getActive(Class<Object> scope)
	{
		return ((Class<Object>) scope).cast(active);
	}

	/**
	 * Sets the active option value
	 * 
	 * @param active
	 *            accordion active
	 */
	public void setActive(String active)
	{
		this.active = (String) active;
		this.options.put("active", "active:'" + active + "'");
	}

	/**
	 * Sets the active option value
	 * 
	 * @param active
	 *            accordion active
	 */
	public void setActive(Boolean active)
	{
		this.active = (Boolean) active;
		this.options.put("active", "active:" + active);
	}

	/**
	 * Sets the active option value
	 * 
	 * @param active
	 *            accordion active
	 */
	public void setActive(Integer active)
	{
		this.active = (Integer) active;
		this.options.put("active", "active:" + active);
	}

	/**
	 * Gets the selected class value
	 * 
	 * @return the selected class value
	 */
	public String getSelectedClass()
	{
		return selectedClass;
	}

	/**
	 * Sets the selected class option value
	 * 
	 * @param selectedClass
	 *            accordion selectedClass
	 */
	public void setSelectedClass(String selectedClass)
	{
		this.selectedClass = selectedClass;
		this.options.put("selectedClass", "selectedClass:'" + selectedClass + "'");
	}

	/**
	 * Gets the always open value
	 * 
	 * @return the always open value
	 */
	public Boolean getAlwaysOpen()
	{
		return alwaysOpen;
	}

	/**
	 * Sets the alwaysOpen option value
	 * 
	 * @param alwaysOpen
	 *            accordion alwaysOpen
	 */
	public void setAlwaysOpen(Boolean alwaysOpen)
	{
		this.alwaysOpen = alwaysOpen;
		this.options.put("alwaysOpen", "alwaysOpen:" + alwaysOpen);
	}

	/**
	 * Gets the animated value
	 * 
	 * @param scope
	 * @return the animated value
	 */
	public Object getAnimated(Class<Object> scope)
	{
		return ((Class<Object>) scope).cast(animated);
	}

	/**
	 * Sets the animated option value
	 * 
	 * @param animated
	 *            accordion animated
	 */
	public void setAnimated(String animated)
	{
		this.animated = (String) animated;
		this.options.put("animated", "animated:'" + animated + "'");
	}

	/**
	 * Sets the animated option value
	 * 
	 * @param animated
	 *            accordion animated
	 */
	public void setAnimated(boolean animated)
	{
		this.animated = (Boolean) animated;
		this.options.put("animated", "animated:" + animated);
	}

	/**
	 * Gets the event value
	 * 
	 * @return the event value
	 */
	public String getEvent()
	{
		return event;
	}

	/**
	 * Sets the event option value
	 * 
	 * @param event
	 *            accordion event
	 */
	public void setEvent(String event)
	{
		this.event = event;
		this.options.put("event", "event:'" + event + "'");
	}

	/**
	 * Gets the navigation value
	 * 
	 * @return the navigation value
	 */
	public Boolean getNavigation()
	{
		return navigation;
	}

	/**
	 * Sets the navigation option value
	 * 
	 * @param navigation
	 *            accordion navigation
	 */
	public void setNavigation(boolean navigation)
	{
		this.navigation = navigation;
		this.options.put("navigation", "navigation:" + navigation);
	}

	/**
	 * Gets the auto height value
	 * 
	 * @return the auto height value
	 */
	public Boolean getAutoHeight()
	{
		return autoHeight;
	}

	/**
	 * Sets the autoHeight option value
	 * 
	 * @param autoHeight
	 *            accordion autoHeight
	 */
	public void setAutoHeight(boolean autoHeight)
	{
		this.autoHeight = autoHeight;
		this.options.put("autoheight", "autoheight:" + autoHeight);
	}

	/**
	 * Gets the clear style value
	 * 
	 * @return the clear style value
	 */
	public Boolean getClearStyle()
	{
		return clearStyle;
	}

	/**
	 * Sets the clearStyle option value
	 * 
	 * @param clearStyle
	 *            accordion clearStyle
	 */
	public void setClearStyle(boolean clearStyle)
	{
		this.clearStyle = clearStyle;
		this.options.put("clearStyle", "clearStyle:" + clearStyle);
	}

	/**
	 * Gets the fill space value
	 * 
	 * @return the fill space value
	 */
	public boolean isFillSpace()
	{
		return fillSpace;
	}

	/**
	 * Sets the fillSpace option value
	 * 
	 * @param fillSpace
	 *            accordion fillSpace
	 */
	public void setFillSpace(boolean fillSpace)
	{
		this.fillSpace = fillSpace;
		this.options.put("fillSpace", "fillSpace:" + fillSpace);
	}

	/**
	 * Gets the navigation filter function
	 * 
	 * @return the navigation filter function
	 */
	public String getNavigationFilter()
	{
		return navigationFilter;
	}

	/**
	 * Sets the navigation filter option value
	 * 
	 * @param navigationFilter
	 *            accordion navigationFilter
	 */
	public void setNavigationFilter(String navigationFilter)
	{
		this.navigationFilter = navigationFilter;
		this.options.put("navigationFilter", "navigationFilter:function(){" + navigationFilter + "}");
	}

}
